layui.use(['laypage', 'laydate','layer','jquery','form'], function(laypage,laydate,layer,$,form){
    //日期范围
    laydate.render({
        elem: '#startTime',
        range: true
    });
    //页码
    laypage.render({
        elem: 'page',
        count: 1000,
        layout: ['count', 'prev', 'page', 'next', 'limit','skip'],
        jump: function(obj){
            console.log(obj)
        }
    });

    var active = {
        offset: function(othis){
            var type = othis.data('type')
                ,text = othis.text();

            layer.open({
                type: 1,
                offset: type,
                title:'资金方请求',
                id: 'layerDemo'+type,
                content:$("#cly-layerCon"),
                btn: ['确定', '关闭'],
                btnAlign: 'c', //按钮居中
                shade: 0, //不显示遮罩
                area:['760px','350px'],
                yes: function(){
                    alert();
                },
                btn2: function(){
                    layer.closeAll();
                }
            });
        },

        detail:function(othis) {
            var type = othis.data('type'), text = othis.text();

            layer.open({
                type: 2,
                offset: type,
                title: '资金方请求',
                content: 'dianziQingqiuDetail.html',
                shade: 0, //不显示遮罩
                area: ['100%', '100%'],
                end:function () {
                    layer.closeAll();
                }
            });
        }
    };
    $('#layerDemo .layui-btn').on('click', function(){
        var othis = $(this), method = othis.data('method');
        active[method] ? active[method].call(this, othis) : '';
    });
});